#ifndef PROTOCOL_H
#define PROTOCOL_H

#include <QString>
#include <QDateTime>


#define Key_WifiName    "wifiName"
#define Key_WifiPwd     "wifiPwd"
#define Key_WifiAutoConn  "wifiAutoConn"

#define Key_MqttPath    "mqttPath"
#define Key_MqttPort    "mqttPort"
#define Key_MqttName    "mqttName"
#define Key_MqttPwd     "mqttPwd"
#define Key_MqttAutoConn  "mqttAutoConn"

#define Key_WaitTime  "drink_waitTime"
#define Key_OutTime_1 "drink_out1Time"
#define Key_OutTime_2 "drink_out2Time"
#define Key_OutTime_3 "drink_out3Time"
#define Key_OutTime_4 "drink_out4Time"

#define Key_ChangePeriod "changePeriod"
#define Key_ChangeTime "changeTime"

#define Ctl_Reboot  "reboot"
#define Ctl_Time "time"
#define Ctl_WifiConnState  "wifiConnState"


class Protocol
{
public:
    Protocol();
    static QString setCMD(QString key,QString value);
    static QString getCMD(QString key);
    static QString ctlCMD(QString key,QString value);

    static QString cmd_setTime(QDateTime time);

    static QString cmd_getWifi();
    static QString cmd_setWifi(QString name,QString pwd,bool flag);
    static QString cmd_setWifiName(QString name);
    static QString cmd_setWifiPwd(QString pwd);
    static QString cmd_setWifiAutoConn(bool flag);
    static QString cmd_ctlWifiConn(bool flag = 1);

    static QString cmd_getMqtt();
    static QString cmd_setMqtt(QString path,QString port,QString name,QString pwd,bool flag);
    static QString cmd_setMqttPath(QString path);
    static QString cmd_setMqttPort(QString port);
    static QString cmd_setMqttName(QString name);
    static QString cmd_setMqttPwd(QString pwd);
    static QString cmd_setMqttAutoConn(bool flag);

    static QString cmd_getSwitchTime();
    static QString cmd_setSwitchTime(int waitTime,
                                     int outTime_1, int outTime_2, int outTime_3, int outTime_4,
                                     int changePeriod, int changeTime);
    static QString cmd_setWaitTime(int time);
    static QString cmd_setOutTime_1(int time);
    static QString cmd_setOutTime_2(int time);
    static QString cmd_setOutTime_3(int time);
    static QString cmd_setOutTime_4(int time);
    static QString cmd_setChangePeriod(int time);
    static QString cmd_setChangeTime(int time);
};

#endif // PROTOCOL_H
